package com.zyc.studentstudy

import android.view.View
import com.zyc.studentstudy.databinding.ActivityMainBinding
import com.zyc.studentstudy.simple.SimpleActivity
import com.zyc.studentstudy.ui.word.WordFragment
import com.zyc.studentstudy.ui.youdao.YoudaoListFragment
import com.zyc.studentstudy.utils.FragmentsUtil

class MainActivity : SimpleActivity() {

    private lateinit var mDB: ActivityMainBinding

    override fun useDatabing(): View? {
        mDB = ActivityMainBinding.inflate(layoutInflater)
        return mDB.root
    }

    override fun initView() {
        val wordFragment = FragmentsUtil.sNewStance(this, WordFragment::class.java) as WordFragment
        val youdaoListFragment =
            FragmentsUtil.sNewStance(this, YoudaoListFragment::class.java) as YoudaoListFragment
        supportFragmentManager.beginTransaction()
            .add(R.id.fl_main_word, wordFragment)
            .add(R.id.fl_main_youdao, youdaoListFragment)
            .commit()
    }

    override fun initEvent() {
    }

    override fun initData() {
    }
}